import request from '@/utils/request'

// 新增图书分类
export function addBookType(data) {
  return request({
    url: '/dev-api/bookTypes/add',
    method: 'post',
    data
  })
}

// 删除图书分类
export function deleteBookType(id) {
  return request({
    url: `/dev-api/bookTypes/${id}`,
    method: 'delete'
  })
}

// 更新图书分类
export function updateBookType(data) {
  return request({
    url: '/dev-api/bookTypes/edit',
    method: 'post',
    data
  })
}

// 根据 ID 查询图书分类
export function getBookTypeById(id) {
  return request({
    url: `/dev-api/bookTypes/${id}`,
    method: 'get'
  })
}

// 查询所有图书分类（支持模糊查询）
export function getAllBookTypes(params) {
  return request({
    url: '/dev-api/bookTypes/list',
    method: 'get',
    params
  })
}

//批量删除
export function delBatchBookType(data){
  return request({
    url: '/dev-api/bookTypes/delBatch',
    method: 'Post',
    data
  })
}

//导入报表
export function importBookType(data){
  return request({
    url: '/dev-api/bookTypes/import',
    method: 'Post',
    data
  })
}